<!DOCTYPE html>
<html class="loading" lang="en" data-textdirection="ltr" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <title>外卖系统管理员</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/vendors.css}">
</head>
<body class="vertical-layout vertical-menu 2-columns   menu-expanded fixed-navbar" data-open="click"
      data-menu="vertical-menu" data-color="bg-gradient-x-purple-blue" data-col="2-columns">
<nav class="header-navbar navbar-expand-md navbar navbar-with-menu navbar-without-dd-arrow fixed-top navbar-semi-light">
    <div class="navbar-wrapper">
        <div class="navbar-container content">
            <div class="collapse navbar-collapse show" id="navbar-mobile">
                <ul class="nav navbar-nav mr-auto float-left">
                    <li class="nav-item mobile-menu d-md-none mr-auto"><a
                            class="nav-link nav-menu-main menu-toggle hidden-xs" href="javascript:;"><i
                            class="ft-menu font-large-1"></i></a></li>
                    <li class="nav-item d-none d-md-block"><a class="nav-link nav-menu-main menu-toggle hidden-xs"
                                                              href="javascript:;"><i class="ft-menu"></i></a></li>
                    <li class="nav-item dropdown navbar-search"><a class="nav-link dropdown-toggle hide"
                                                                   data-toggle="dropdown" href="javascript:;"><i
                            class="ficon ft-search"></i></a>
                        <ul class="dropdown-menu">
                            <li class="arrow_box">
                                <form>
                                    <div class="input-group search-box">
                                        <div class="position-relative has-icon-right full-width">
                                            <input class="form-control" id="search" type="text"
                                                   placeholder="Search here...">
                                            <div class="form-control-position navbar-search-close"><i class="ft-x"></i>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav float-right">
                    <li class="dropdown dropdown-user nav-item"><a class=" nav-link dropdown-user-link"
                                                                   href="/admin/login"> <span class="username"><i
                            class="ft-power"></i>退出登录</span> </a></li>
                    <li class="dropdown dropdown-user nav-item"><a class="dropdown-toggle nav-link dropdown-user-link"
                                                                   href="javascript:;"> <span
                            class="username">Admin</span> <span class="avatar avatar-online"><img
                            th:src="@{/images/adminlogo.webp}" alt="avatar"></span> </a></li>
                </ul>
            </div>
        </div>
    </div>
</nav>
<div class="main-menu menu-fixed menu-light menu-accordion    menu-shadow " data-scroll-to-active="true">
    <div class="navbar-header">
        <ul class="nav navbar-nav flex-row">
            <li class="nav-item mr-auto"><a class="navbar-brand" href="/admin/index">
                <h3 class="brand-text">外卖系统管理员</h3>
            </a></li>
            <li class="nav-item d-md-none"><a class="nav-link close-navbar"><i class="ft-x"></i></a></li>
        </ul>
    </div>
    <div class="main-menu-content">
        <ul class="navigation navigation-main" id="main-menu-navigation" data-menu="menu-navigation">
            <li class=" nav-item "><a th:href="@{/admin/index}"><i class="ft-home"></i><span class="menu-title">首页</span></a></li>
            <li class="nav-item "><a href="javascript:;"><i class="la la-medkit"></i><span
                    class="menu-title"> 商家管理</span></a>
                <ul class="menu-content">
                    <li><a class="menu-item" th:href="@{/admin/store}">商家入驻审核</a></li>
                </ul>
            </li>
            <li class="nav-item "><a href="javascript:;"><i class="ft-users"></i><span
                    class="menu-title"> 用户管理</span></a>
                <ul class="menu-content">
                    <li><a class="menu-item" th:href="@{/admin/user}">用户订单申诉审核</a></li>
                </ul>
            </li>
        </ul>
    </div>
    <div class="navigation-background"></div>
</div>
<div class="app-content content">
    <div class="content-wrapper">
        <div class="content-wrapper-before"></div>
        <div class="content-header row">
            <div class="content-header-left col-md-4 col-12 mb-2">
                <h3 class="content-header-title">商家入驻审核</h3>
            </div>
            <div class="content-header-right col-md-8 col-12">
                <div class="breadcrumbs-top float-md-right">
                    <div class="breadcrumb-wrapper mr-1">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item"><a href="/admin/index">主页</a></li>
                            <li class="breadcrumb-item active">商家入驻审核</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <div class="content-body">
            <section class="file-browser">
                <div class="card" style="">
                    <div class="card-header">
                        <label class="card-title">商家列表</label>
                    </div>
                    <div class="card-body">
                        <div class="selbox">
                            <!--name= "searchForm"根据 name 获取 form 的DOM对象-->
                            <form name="searchForm" th:action="@{/admin/store}" method="get">
                                <input type="hidden" name="page" value="1" id="page">
                                <div class="form1">
                                    <ul class="row">
                                        <li class="col-xs-4">
                                            <span>审核状态：</span>
                                            <select class="form-control m-b" name="storeRegisterState"
                                                        th:with="professionals =  ${@SysDictDataService.selectDictDataByType('sys_store_register_state')}">
                                                <option value="">——请选择审核状态——</option>
                                                <option th:each="profession : ${professionals}"
                                                        th:selected="${(store.storeRegisterState + '') eq profession.dictValue ? true : false}"
                                                        th:value="${profession.dictValue}"
                                                        th:text="${profession.dictLabel}">
                                                </option>
                                            </select>


                                        </li>
                                        <li class="col-xs-4">
                                            <span>店铺名称：</span>
                                            <input type="text" class="form-control" name="storeName" th:value="${store.storeName}" placeholder="店铺名称">
                                        </li>
                                        <li class="col-xs-4" style="padding-left: 10px">
                                            <a href="javascript:;" class="btn btn-primary" onclick="toSearch(1)">查询</a>
                                            <a href="javascript:;" class="btn btn-default" onclick="resetForm()">重置</a>
                                        </li>
                                    </ul>
                                </div>
                            </form>

                            <div class="tablebox">
                                <table class="table">
                                    <thead>
                                    <tr>
                                        <th width="5%">序号</th>
                                        <th width="8%">店铺id</th>
                                        <th width="10%">店铺名称</th>
                                        <th width="15%">手机号码</th>
                                        <th>店铺简介</th>
                                        <th width="8%">审核状态</th>
                                        <th width="8%">查看信息</th>
                                    </tr>
                                    </thead>
                                    <tr th:each="store,stat : ${storeAdminList}">
                                        <td th:text="${stat.count}"></td>
                                        <td th:text="${store.storeId}">店铺id</td>
                                        <td th:text="${store.storeName}">店铺名称</td>
                                        <td th:text="${store.storePhone}">手机号码</td>
                                        <td th:title="${store.storeIntroduce}"
                                            th:text="${#strings.abbreviate(store.storeIntroduce,50)}">店铺简介
                                        </td>
                                        <td th:text="${@SysDictDataService.selectDictLabel('sys_store_register_state',store.storeRegisterState)}">审核状态</td>
                                        <td>
                                            <span>
                                                <a th:href="@{/admin/store/{id}(id=${store.storeId})}">
                                                    <img th:src="@{/images/xiugai.png}" title="修改">
                                                </a>
                                            </span>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <nav aria-label="Page navigation" class="page">
                                <ul class="pagination">
                                    <li class="page-item">
                                        <a>
                                            <span th:text="${'共&nbsp; '+  pageInfo.total +'&nbsp;条记录
                                            &nbsp;&nbsp;&nbsp;'+ pageInfo.pageNum + ' / '+pageInfo.pages+' 页
                                            &nbsp;&nbsp;&nbsp;&nbsp;'}"></span>
                                        </a>
                                    </li>
                                    <li class="page-item" th:if="${pageInfo.hasPreviousPage}">
                                        <a class="page-link" href="javascript:;" aria-label="Previous" th:onclick="'toSearch(1)' ">
                                            <span aria-hidden="true">首页</span>
                                        </a></li>
                                    <li class="page-item" th:if="${pageInfo.hasPreviousPage}">
                                        <a class="page-link" href="javascript:;" aria-label="Previous" th:onclick="'toSearch(' + ${pageInfo.prePage} + ')' ">
                                            <span aria-hidden="true">上一页</span>
                                    </a></li>

                                    <!--页码区-->
                                    <li th:class="'page-item ' + ${nav == pageInfo.pageNum ? 'active' : ''}" th:each="nav : ${pageInfo.navigatepageNums}">
                                        <a class="page-link" href="javascript:;" th:text="${nav}" th:onclick="'toSearch(' + ${nav} + ')' ">1</a>
                                    </li>


                                    <li class="page-item" th:if="${pageInfo.hasNextPage}">
                                        <a class="page-link" href="javascript:;" aria-label="Next" th:onclick="'toSearch(' + ${pageInfo.nextPage} + ')' ">
                                            <span aria-hidden="true">下一页</span>
                                        </a>
                                    </li>
                                    <li class="page-item" th:if="${pageInfo.hasNextPage}">
                                        <a class="page-link" href="javascript:;" aria-label="Next" th:onclick="'toSearch(' + ${pageInfo.pages} + ')' ">
                                            <span aria-hidden="true">尾页</span>
                                        </a>
                                    </li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </div>
</div>

<!-- BEGIN VENDOR JS-->
<script th:src="@{/js/vendors.min.js}" type="text/javascript"></script>
<script th:src="@{/js/app-menu.js}" type="text/javascript"></script>
<script th:src="@{/js/app.js}" type="text/javascript"></script>
<script th:src="@{/js/echarts.min.js}" type="text/javascript"></script>
<script th:src="@{/laydate/laydate.js}" type="text/javascript"></script>
<script>
    lay('#version').html('-v' + laydate.v);
    laydate.render({
        elem: '#date'
        , range: true
        , theme: '#6967ce'
    });

    /**用户点击“查看”按钮时触发**/
    function toSearch(num) {
        var form = $("form[name=searchForm]");
        $('#page').val(num);
        form.submit();
    }
    /**重置查询条件函数**/
    function resetForm() {
        var form = $("form[name=searchForm]");
        $("select[name='storeRegisterState']").val('');
        $("input[name='storeName']").val("");
        form.submit();

    }

</script>
</body>
</html>